<template>
  <div class="news-info">
    <van-panel
      :title="newsInfo.zhaiyao"
      :status="`阅读${newsInfo.click}`"
    >
      <div class="content">{{newsInfo.content}}</div>
    </van-panel>

    <Comment :id="id"></Comment>
  </div>
</template>
<script>
// @ 相对于绝对路径 src
import Comment from "@/components/Comment"
export default {
  props: ["id"],
  data: () => ({
    newsInfo: {}
  }),
  created() {
    // console.log(this.$route.params.id)
    this.getNewsInfo()
  },
  methods: {
    async getNewsInfo() {
      const res = await this.$http.getNewsInfo(this.id)
      this.newsInfo = res.data.message
    }
  },
  components: {
    Comment
  }
}
</script>
<style lang="scss" scoped>
.news-info {
  padding: 0 10px;
  .van-cell__title {
    font-size: 14px;
    font-weight: 600;
    flex: 1.5;
  }
  .content {
    font-size: 12px;
    text-indent: 2em;
  }
}
</style>
